from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
from datiandouweb.views.mainviews import authority
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin

admin.autodiscover()
from django.conf.urls import *
handler404 = 'datiandouweb.views.MainViews.get_404'
handler500 = 'datiandouweb.views.MainViews.get_404'
urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'datiandou.views.home', name='home'),
    url(r'^datiandou/', include('datiandouweb.urls')),

    (r'^admin/', include(admin.site.urls)),
    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),

)
#if settings.DEBUG:
#    urlpatterns += patterns('',
    #                        (r'^static/media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_URL, 'show_indexes':True}),
     #                       )



if settings.DEBUG  is False:
    urlpatterns += patterns('',
                            url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {
                                'document_root': settings.STATIC_ROOT,
                                }),
                            )